package com.example.esdemo.rabbitmq;

import com.example.esdemo.es.entities.EsPost;
import lombok.Data;

import java.io.Serializable;

/**
 * 消息实体
 *
 * @author Cary
 * @date 2022/6/21
 */
@Data
public class ESMqMessage implements Serializable {
    /**
     * 新增或修改
     */
    public final static String CREATE_OR_UPDATE = "create_or_update";
    /**
     * 删除
     */
    public final static String REMOVE = "remove";
    public final static String TEST = "test";
    public final static String TEST2 = "test2";
    /**
     * 文章
     */
    private EsPost esPost;
    /**
     * 文章操作类型
     */
    private String action;

    public ESMqMessage(EsPost esPost, String action) {
        this.esPost = esPost;
        this.action = action;
    }
}
